pub struct Solution;


impl Solution {
    pub fn find_lu_slength(a: String, b: String) -> i32 {
        if !b.contains(&a) { return a.len() as i32; }
        let mut tmp = a;
        let mut count = 1;

        while !b.contains(&tmp) && count != tmp.len() {
            if let Some(s) = tmp.get(count..tmp.len()) {
                if b.contains(s) {
                    return tmp.len() as i32;
                }
            }
            if let Some(s) = tmp.get(0..tmp.len() - count) {
                if b.contains(s) {
                    return tmp.len() as i32;
                }
            }
            count += 1;
        }
        -1
    }
}